﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using QLTV.Public;
using QLTV.BLL;

namespace QLTV.GUI.Forms
{
    public partial class frmTimDocGia : Form
    {
        DocGiaDTO dgDTO = new DocGiaDTO();
        DocGiaBLL dgBLL = new DocGiaBLL();
        public frmTimDocGia()
        {
            InitializeComponent();
        }

        private void btnTim_Click(object sender, EventArgs e)
        {
            if (cbbCotTK.Text == "Mã độc giả")
            {
                dgDTO.MaDG = txtTimKiem.Text;
                GridTimDG.DataSource = dgBLL.TimDG_MaDG(dgDTO);
            }
            if (cbbCotTK.Text == "Tên độc giả")
            {
                dgDTO.HoVaTen = txtTimKiem.Text;
                GridTimDG.DataSource = dgBLL.TimDG_HoTen(dgDTO);
            }
        }

        private void txtTimKiem_EditValueChanged(object sender, EventArgs e)
        {
           // if (cbbCotTK.Text == "Mã độc giả")
          //  {
            //    dgDTO.MaDG = txtTimKiem.Text;
              //  GridTimDG.DataSource = dgBLL.TimDG_MaDG(dgDTO);

               /* if (txtTimKiem.Text.ToString().Trim().Length == 0)
                {
                    dgDTO.MaDG = cbbCotTK.Text;
                    GridTimDG.DataSource = dgBLL.TimDG_LoaiDG(dgDTO);
                }*/
                /*else
                {
                    dsDTO.MaTL = cbTheLoai.Text;
                    dsDTO.TenDS = txtGiaTriTimKiem.Text.ToString().Trim();
                    gridTraCuuSach.DataSource = dsBLL.timDauSachTheoTheLoai_TenDS(dsDTO);
                }*/
         //   }
           /* if (cbbCotTK.Text == "Tên độc giả")
            {
                dgDTO.HoVaTen = txtTimKiem.Text;
                GridTimDG.DataSource = dgBLL.TimDG_HoTen(dgDTO);
            }*/
        }
    }
}
